package cn.nutz.service.impl;

import cn.nutz.entity.User;
import cn.nutz.service.UserService;
import org.nutz.dao.Dao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Jianghao on 2017/9/3
 *
 * @howechiang
 */
@Service
public class UserServiceImpl implements UserService {

    private static Logger log = LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    protected Dao dao;

    @Override
    public List<User> findAll() {
        return dao.query(User.class, null);
    }

    @Override
    public void insert(User user) {
        dao.insert(user);
    }
}
